import java.util.ArrayList;
import java.io.*;
import javax.swing.JTextArea;
import javax.swing.JTextField;


public class Consumable extends Item implements Serializable {

	private double HPmodifier;
	
	public Consumable(String a, String b, String c, String d, double e, int f) {
			super(a, b, c, d, e);
			HPmodifier = f;
	}
	
	
	public void consume(Player a, JTextArea y) {
		a.modifyCurrentHP(HPmodifier);
		if (a.getCurrentHP() > a.getMaxHP()) {
			a.setCurrentHP(a.getMaxHP());
		}
		y.append("You consume the " + Name + ". ");
			if (HPmodifier > 0) {
				y.append("You feel refreshed.");
			} else {
				y.append("You feel sick!");
			}
	}
		
		
	
	
}
